window.onload = function () {
    searchOrder(1)
}

let status = "不限"
function setStatus(){
    var objS = document.getElementById("select");
    status = objS.options[objS.selectedIndex].value;
}

function searchOrder(pageNO) {
    axios.get("/order/manager/selectByItems",{
        params:{
            pageNO,
            status,
            startDate: $('mStartDate').value,
            endDate:$("mEndDate").value
        }
    }).then(resp =>{

        var info = resp.data;
        if (info != ""){
            str = ""
            info.records.forEach(n=>{
                str += `<tr>
<td>${n.id}</td><td>${n.money}</td><td>${n.status}</td><td>${n.date}</td><td><a href="/manager/showOrder.html?orderId=${n.id}">查看明细</a></td>
</tr>`
            })
            $('managerOrder').innerHTML  = str

            var cutStr=""
            for (let i = 1;i <= info.pages;i++){
                cutStr += `<a style="margin-left: 10px;" href="javascript:searchOrder(${i})">${i}</a>`
            }

            $('managerOrderDiv').innerHTML = cutStr
        }
    })
}